Optimal. Leaf size=327 \[ -\frac {c^4 \left (b^2 B (2-m)+2 a A b (3-m)+a^2 B (3-m)\right ) \, _2F_1\left (\frac {1}{2},\frac {4-m}{2};\frac {6-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^{-4+m} \sin (e+f x)}{f (2-m) (4-m) \sqrt {\sin ^2(e+f x)}}-\frac {c^3 \left (A b^2 (1-m)+2 a b B (1-m)+a^2 A (2-m)\right ) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^{-3+m} \sin (e+f x)}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {a c^3 (a B (1-m)-A b m) (c \sec (e+f x))^{-3+m} \tan (e+f x)}{f (1-m) (2-m)}-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.41, antiderivative size = 327, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3039, 4111,
4132, 3857, 2722, 4131} \begin {gather*} -\frac {c^4 \sin (e+f x) \left (a^2 B (3-m)+2 a A b (3-m)+b^2 B (2-m)\right ) (c \sec (e+f x))^{m-4} \, _2F_1\left (\frac {1}{2},\frac {4-m}{2};\frac {6-m}{2};\cos ^2(e+f x)\right )}{f (2-m) (4-m) \sqrt {\sin ^2(e+f x)}}-\frac {c^3 \sin (e+f x) \left (a^2 A (2-m)+2 a b B (1-m)+A b^2 (1-m)\right ) (c \sec (e+f x))^{m-3} \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right )}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {a c^3 \tan (e+f x) (a B (1-m)-A b m) (c \sec (e+f x))^{m-3}}{f (1-m) (2-m)}-\frac {a A c^3 \tan (e+f x) (a \sec (e+f x)+b) (c \sec (e+f x))^{m-3}}{f (1-m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3039
Rule 3857
Rule 4111
Rule 4131
Rule 4132
Rubi steps
\begin {align*} \int (a+b \cos (e+f x))^2 (A+B \cos (e+f x)) (c \sec (e+f x))^m \, dx &=c^3 \int (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x))^2 (B+A \sec (e+f x)) \, dx\\ &=-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)}-\frac {c^3 \int (c \sec (e+f x))^{-3+m} \left (-b (b B (1-m)+a A (3-m))-\left (b (A b+2 a B) (1-m)+a^2 A (2-m)\right ) \sec (e+f x)-a (a B (1-m)-A b m) \sec ^2(e+f x)\right ) \, dx}{1-m}\\ &=-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)}-\frac {c^3 \int (c \sec (e+f x))^{-3+m} \left (-b (b B (1-m)+a A (3-m))-a (a B (1-m)-A b m) \sec ^2(e+f x)\right ) \, dx}{1-m}+\frac {\left (c^2 \left (A b^2 (1-m)+2 a b B (1-m)+a^2 A (2-m)\right )\right ) \int (c \sec (e+f x))^{-2+m} \, dx}{1-m}\\ &=-\frac {a c^3 (a B (1-m)-A b m) (c \sec (e+f x))^{-3+m} \tan (e+f x)}{f (1-m) (2-m)}-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)}+\frac {\left (c^3 \left (b^2 B (2-m)+2 a A b (3-m)+a^2 B (3-m)\right )\right ) \int (c \sec (e+f x))^{-3+m} \, dx}{2-m}+\frac {\left (c^2 \left (A b^2 (1-m)+2 a b B (1-m)+a^2 A (2-m)\right ) \left (\frac {\cos (e+f x)}{c}\right )^m (c \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{c}\right )^{2-m} \, dx}{1-m}\\ &=-\frac {\left (A b^2 (1-m)+2 a b B (1-m)+a^2 A (2-m)\right ) \cos ^3(e+f x) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {a c^3 (a B (1-m)-A b m) (c \sec (e+f x))^{-3+m} \tan (e+f x)}{f (1-m) (2-m)}-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)}+\frac {\left (c^3 \left (b^2 B (2-m)+2 a A b (3-m)+a^2 B (3-m)\right ) \left (\frac {\cos (e+f x)}{c}\right )^m (c \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{c}\right )^{3-m} \, dx}{2-m}\\ &=-\frac {\left (A b^2 (1-m)+2 a b B (1-m)+a^2 A (2-m)\right ) \cos ^3(e+f x) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{f (1-m) (3-m) \sqrt {\sin ^2(e+f x)}}-\frac {\left (b^2 B (2-m)+2 a A b (3-m)+a^2 B (3-m)\right ) \cos ^4(e+f x) \, _2F_1\left (\frac {1}{2},\frac {4-m}{2};\frac {6-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{f (2-m) (4-m) \sqrt {\sin ^2(e+f x)}}-\frac {a c^3 (a B (1-m)-A b m) (c \sec (e+f x))^{-3+m} \tan (e+f x)}{f (1-m) (2-m)}-\frac {a A c^3 (c \sec (e+f x))^{-3+m} (b+a \sec (e+f x)) \tan (e+f x)}{f (1-m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.00, size = 205, normalized size = 0.63 \begin {gather*} \frac {\cot (e+f x) \left (\frac {b^2 B \cos ^3(e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-3+m);\frac {1}{2} (-1+m);\sec ^2(e+f x)\right )}{-3+m}+\frac {b (A b+2 a B) \cos ^2(e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-2+m);\frac {m}{2};\sec ^2(e+f x)\right )}{-2+m}+a \left (\frac {(2 A b+a B) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1}{2} (-1+m);\frac {1+m}{2};\sec ^2(e+f x)\right )}{-1+m}+\frac {a A \, _2F_1\left (\frac {1}{2},\frac {m}{2};\frac {2+m}{2};\sec ^2(e+f x)\right )}{m}\right )\right ) (c \sec (e+f x))^m \sqrt {-\tan ^2(e+f x)}}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.59, size = 0, normalized size = 0.00 \[\int \left (a +b \cos \left (f x +e \right )\right )^{2} \left (A +B \cos \left (f x +e \right )\right ) \left (c \sec \left (f x +e \right )\right )^{m}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c \sec {\left (e + f x \right )}\right )^{m} \left (A + B \cos {\left (e + f x \right )}\right ) \left (a + b \cos {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int {\left (\frac {c}{\cos \left (e+f\,x\right )}\right )}^m\,\left (A+B\,\cos \left (e+f\,x\right )\right )\,{\left (a+b\,\cos \left (e+f\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________